/*---------------*/
/* Joseph Porter */
/* Summer of 2012*/
/* Team 1247     */
/*www.ROKSBOT.com*/
/* GyroScope     */
/*---------------*/
package Team1247Classes.Sensors;

import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.Gyro;




public class GyroscopeHandler {   
    private Gyro gyroscope;
    private double gyroAngle;
    private AnalogChannel analogIn;
    public GyroscopeHandler(int analogChannel){
        this.gyroscope = new Gyro(analogChannel);
        this.analogIn = new AnalogChannel(analogChannel);
        
    }
    public double getRelativeAngle(){
        this.gyroAngle = this.gyroscope.getAngle();
        while(this.gyroAngle > 360){
            this.gyroAngle = this.gyroscope.getAngle()-360;
        }
        return Math.floor(this.gyroAngle);
    }
    public double getTrueAngle(){
        return Math.floor(this.gyroscope.getAngle());
        
    }
    public double getRawVoltage(){
        return analogIn.getAverageVoltage();
    }
}
